package com.itheima.mapper;

import com.itheima.pojo.Student;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {
    List<Student> list(StudentQueryParam studentQueryParam);

    void delete(List<Integer> ids);

    @Select("select * from student where id = #{id}")
    Student getById(Integer id);


    void updateById(Student student);

    void save(Student student);

    @Update("update student set violation_count = violation_count + 1," +
            "violation_score = violation_score + #{score} where id = #{id}")
    void update(Integer id, Integer score);

    List<Map> getStudentDegreeData();

    List<Map<Object, Object>> getStudentCountData();
}
